<template>
  <!-- 编辑记录 -->
  <h-modal class="event-modal" v-model="show" title="单位评分编辑记录" @submit="show = false">
    <a-form-model :model="form" size="large">
      <a-row :gutter="100">
        <a-col :span="24">
          <a-form-model-item label="">
            <h-table
              ref="htable"
              @init="getList"
              :config="config"
              :showHeadBgNone="false"
              :zebraStripes="false">

            </h-table>
          </a-form-model-item>

        </a-col>
      </a-row>

    </a-form-model>
  </h-modal>
</template>

<script>
import moment from 'moment';
import { updateScoreList } from '@/api/dept';
export default {
  props: {
    showModal: {
      type: Boolean,
      default: false
    },
    id: String
  },
  model: {
    prop: 'showModal',
    event: 'update:showModal'
  },
  watch: {
    showModal: {
      handler(val) {
        this.show = val;
        if (val) {
          this.getList();
        }
      },
      immediate: true
    },
    show(val) {
      this.$emit('update:showModal', val);
    }
  },
  data() {
    return {
      moment,
      show: false,
      form: {},
      config: {
        rowKey: 'id',
        dataSource: [],
        columns: [
          {
            align: 'center',
            title: '编辑人',
            dataIndex: 'createBy'
          },
          {
            align: 'center',
            title: '时间',
            dataIndex: 'createTime'
          },
          {
            align: 'center',
            title: '编辑内容',
            dataIndex: 'editContent'
          }
        ],
        pagination: false
      }
    };
  },
  methods: {
    getList(params) {
      updateScoreList({ id: this.id }).then(res => {
        this.config.dataSource = res.data;
      });
    },
    select(e) {
      console.log(e);
    }
  }
};
</script>

<style>

</style>
